// index.js
Page({
  data: {
    indicatorDots: true,
    vertical: false,
    autoplay: false,
    interval: 2000,
    duration: 500,
    type: 1,
    picList: [
      'https://healthzhipai.oss-cn-shenzhen.aliyuncs.com/jiajiajian/1-1.jpg',
      'https://healthzhipai.oss-cn-shenzhen.aliyuncs.com/jiajiajian/1-2.jpg',
      'https://healthzhipai.oss-cn-shenzhen.aliyuncs.com/jiajiajian/1-3.jpg',
      'https://healthzhipai.oss-cn-shenzhen.aliyuncs.com/jiajiajian/1-4.jpg',
      'https://healthzhipai.oss-cn-shenzhen.aliyuncs.com/jiajiajian/1-5.jpg',
      'https://healthzhipai.oss-cn-shenzhen.aliyuncs.com/jiajiajian/1-6.jpg',
      'https://healthzhipai.oss-cn-shenzhen.aliyuncs.com/jiajiajian/1-7.jpg',
      'https://healthzhipai.oss-cn-shenzhen.aliyuncs.com/jiajiajian/1-8.jpg',
      'https://healthzhipai.oss-cn-shenzhen.aliyuncs.com/jiajiajian/1-9.jpg'
    ],
    showPopup: false,
    faqList: [
      '如何正确取出样本抽提管？',
      '打开样本抽提管后，应该怎样放置它？',
      '检测卡从铝箔袋取出后要怎么处理？'
    ],
    inputValue: '',
    isRecording: false
  },

  onLoad(options) {
    let type = options.d ?? 1
    if (type == 2) {
      wx.reLaunch({
        url: '/subPages/index/index',
        success:(res)=>{
          console.log(res)
        },
        fail:(res)=>{
          console.log(res)
        },
      })
    }
    else if (type == 3) {
      wx.reLaunch({
        url: '/subPages/three/index',
        success:(res)=>{
          console.log(res)
        },
        fail:(res)=>{
          console.log(res)
        },
      })
    }
  },

  // 切换弹窗显示状态
  togglePopup() {
    this.setData({
      showPopup: !this.data.showPopup
    });
  },

  // 处理常见问题点击
  selectFaq(e) {
    const index = e.currentTarget.dataset.index;
    const selectedFaq = this.data.faqList[index];
    this.setData({
      inputValue: selectedFaq
    });
  },

  handleInput(e) {
    this.setData({
      inputValue: e.detail.value
    });
  },

  // 处理图标按钮点击
  closePopup() {
    this.setData({
      showPopup: false
    });
  }
})
